Adding Active Server Pages

What are Active Server Pages?
Displaying Date, Time, and Text
Using Counters, Variables, and Forms
Displaying Server Statistics
Active Server Pages Server-Side Scripting Programmer's Reference


Displaying Server Statistics in Active Server Pages

This section lists the functions you can use to construct your own customized Active Server Pages (ASP) for keeping track of activity at your Web site.

Is the Server Working?

Server Name

To display the domain name of your Personal Web Server in a Web page, type:

<% =Request.ServerVariables("SERVER_NAME") %>

at the point where you would like it to appear. If your Personal Web Server doesn't have a domain name, use its IP address (numbers separated by periods) instead.

Server Version

To display the version number of Personal Web Server you're using, type:

<% = status.serverVersion %>

where you want it to appear.

Server Start Time

To display the time the server started up, type:

<% =status.startTime %>

where you want it to appear.

Server Start Date

To display the date when the server started up, type:

<% =status.startDate %>

where you want it to appear.

Server Free Memory

To display the amount (in bytes) of available free memory that the server has, type:

<% =status.freemem %>

where you want it to appear.

Server Lowest Free Memory

To display the lowest amount (in bytes) of available free memory that the server has had at any time since it started up, type:

<% =status.freelowmem %>

where you want it to appear.

How Busy Is the Server?

Active HTTP Sessions

To display the number of currently active HTTP sessions, type:

<% = status.activeHttpSessions %>

where you want it to appear.

Highest Number of Active HTTP Sessions

To display the highest number of active HTTP sessions that the server has run simultaneously since it started up, type:

<% = status.highHttpSessions %>

where you want it to appear.

"Busy" Connections

To display the total number of requests that the server has had to refuse since it started up because it was busy, type:

<% = status.busyConnections %>

where you want it to appear.

Refused Connections

To display the total number of connection requests that the server has had to refuse since it started up, type:

<% = status.refusedConnections %>

where you want it to appear.

Timed-Out Connections

To display the total number of connection requests that have timed out since the server started up, type:

<% = status.timedOutConnections %>

where you want it to appear.

Bytes Transferred

To display the total amount (in bytes) of data that has been downloaded since the server started up, type:

<% = status.bytestransferred %>

where you want it to appear.

How Many "Hits" Have There Been?

Requests Today

To display the number of requests (or "hits") that your Personal Web Server has received today, type:

<% =status.requestsToday %>

where you want it to appear. Each time someone views a page on your Web site, that counts as a request.

Requests Since Start

To display the number of requests that your Personal Web Server has received since it started up, type:

<% =status.requestsSinceStart %>

where you want it to appear.

Popular Pages

To display a list of the most popular pages on your Web site, type:

<% = status.popularPages %>

where you want it to appear. The most popular pages are those that have received the greatest number of "hits."

How Many Visitors Have There Been?

Visitors Today

To display the number of people who have visited your Web site today, type:

<% = status.visitorsToday %>

where you want it to appear. This number will be lower than the number of requests today. This is because each visitor makes at least one request, and if someone visits your Web site more than once in a day, only the first visit is counted in visitorsToday.

Visitors Since Start

To display the number of people who have visited your Web site since the server started up, type:

<% = status.visitorsSinceStart %>

where you want it to appear. This number will be lower than the number of requests since the server started up. This is because each visitor makes at least one request, and if someone visits your Web site more than once, only the first visit is counted in visitorsSinceStart.

Recent Visitors

To display a list of the most recent visitors to your Web site, type:

<% = status.recentVisitors %>

where you want it to appear.

Return to top